﻿using UnityEditor;
using UnityEngine;

public class DamageMgr:BaseManager<DamageMgr>
{
    //造成伤害
    public void Damage(Creature caster,Creature target)
    {
        if (!target.CanBeAttack(caster)) { return; }
        var damage = Mathf.Max(1, (caster.ServerData.Attack - target.TableData.Defence));
        target.HP = target.HP - damage;
    }
}
